package com.ds.service;

import com.ds.orm.model.WebsiteConf;
import com.baomidou.mybatisplus.plugins.Page;
import com.ds.core.base.BaseService;
import java.util.HashMap;
import java.util.Map;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 博客页模板配置 服务实现类
 * </p>
 *
 * @author Du
 * @since 2017-12-09
 */
@Service
public class WebsiteConfService extends BaseService<WebsiteConf> {
	
	public WebsiteConf queryByUrl(String url){
		Map<String, Object> params = new HashMap<>();
		params.put("url", url);
		Page<?> page = query(params);
		if (page.getTotal() != 1) {
			return null;
		}
		return (WebsiteConf) page.getRecords().get(0);
	}
}
